﻿Public Class DeleteTemplate

    Private Sub TemplateBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Validate()
        Me.TemplateBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.DigitalDocumentDataSet)

    End Sub

    Private Sub DeleteTemplate_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'DigitalDocumentDataSet.Layer' table. You can move, or remove it, as needed.
        Me.LayerTableAdapter.Fill(Me.DigitalDocumentDataSet.Layer)
        'TODO: This line of code loads data into the 'DigitalDocumentDataSet.Template' table. You can move, or remove it, as needed.
        Me.TemplateTableAdapter.Fill(Me.DigitalDocumentDataSet.Template)

    End Sub

    
    Private Sub DTempl_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DTempl.Click
        Me.Validate()
        Me.TemplateTableAdapter.Delete(Me.DelTemplate.SelectedValue.ToString)

        Me.TemplateTableAdapter.Fill(Me.DigitalDocumentDataSet.Template)

        MsgBox("Deleted")
    End Sub
End Class